<?php
/**
 * Created by PhpStorm.
 * User: xpz
 * Date: 2022/10/31
 * Time: 16:01
 */

namespace app\common\model;
use think\Model;
use think\config;

class Paihang extends Model
{
// 开启自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';
    // 定义时间戳字段名
    protected $createTime = '';
    protected $updateTime = '';


    public function getAvatarAttr($value, $data)
    {
        $avatar = '';
        if(!empty($data['avatar'])){
            $avatar = $data['avatar'];
            if(strstr($data['avatar'],'uploads/header')){
                $avatar = getDomain().$data['avatar'];
            }
        }
        return $avatar;
    }
}